package com.dragon.concurrent.demo.interrupt;

/**
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/6/1 18:31
 */
public class ThreadInterruptTest2 {

    public static void main(String[] args) {
        MyThread2 myThread2 = new MyThread2();
        myThread2.start();
        myThread2.interrupt();
    }
}

class MyThread2 extends Thread {

    @Override
    public void run() {
        System.out.println("myThread2线程进入");
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            System.out.println("myThread2线程被中断了");
        }
    }
}
